# demo05_var.py
# 定义变量/声明变量
"""
num = 20
name = '小明'
is_married = False
print(num, name, is_married)
is_married = True
num = 30
print(num, is_married)
is_married = '离婚'
num = 40
print(num, is_married)
"""
# 命名规则
# a = 1
# a2 = 3
# # 2a = 5  # 不能以数字开头
# _b3 = 7
# # if = 2  # 不能使用关键字
# print(a, a2, _b3)

# 练习：声明多组变量，分别保存商品的单价和数量；声明变量保存商品的总价；计算出上的总价；最后打印出总价
total = 0
price1 = 13.5
num1 = 2
price2 = 49
num2 = 3
price3 = 4.5
num3 = 1.3
total = price1*num1 + price2*num2 + price3*num3
print('总价：', total)
# 要求对总价执行打8折，计算出总价
total = total * 0.8
print('折后：', total)
